package com.sz.pojo.frame;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

import javax.persistence.Entity;
import javax.persistence.Table;

/**
 * 题库
 */
@Entity
@Table(name = "admin_zidian")
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE, region = "pojoCache")
public class ZiDian extends BaseObject<ZiDian> {

    private String name;
    private String pinyin;

    public String getName() {

        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPinyin() {
        return pinyin;
    }

    public void setPinyin(String pinyin) {
        this.pinyin = pinyin;
    }


    public boolean equals(Object object) {
        if (this == object) return true;
        if (!(object instanceof ZiDian)) return false;
        if (!super.equals(object)) return false;

        ZiDian ziDian = (ZiDian) object;

        if (!name.equals(ziDian.name)) return false;
        if (!pinyin.equals(ziDian.pinyin)) return false;

        return true;
    }

    public int hashCode() {
        int result = super.hashCode();
        result = 31 * result + name.hashCode();
        result = 31 * result + pinyin.hashCode();
        return result;
    }


    @Override
    public String toString() {
        return "ZiDian{" +
                "name='" + name + '\'' +
                ", pinyin='" + pinyin + '\'' +
                '}';
    }


}
